Skip to content

CHANGE: Add CI job to check Editor references in Runtime code#2413

Merged
jfreire-unity merged 8 commits intodevelopfrom
add-check-runtime-editor-refs-gha-workflow
May 5, 2026
Merged

CHANGE: Add CI job to check Editor references in Runtime code#2413
jfreire-unity merged 8 commits intodevelopfrom
add-check-runtime-editor-refs-gha-workflow

Conversation

@jfreire-unity
Copy link
Copy Markdown
Collaborator

@jfreire-unity jfreire-unity commented May 4, 2026

Description

Following #2321 we lack the way to validate that new code added to Runtime folder doesn't contain Editor references. This is because we don't have the code in 2 separate assemblies. There might be a better way of achieving this by creating a proper test or somekind of C# code analyzer.
But at this stage, having something is better than nothing.

A text based search using grep seems fast enough, and the script can potentially be added to run in a commit hook.

It runs and fails like this:

image

Logs:

image

Testing status & QA

PS: ⚠️ It's currently macOS only but can potentially be converted to a PowerShell script for Windows as well

Overall Product Risks

Please rate the potential complexity and halo effect from low to high for the reviewers. Note down potential risks to specific Editor branches if any.

  • Complexity: 0
  • Halo Effect: 0

Comments to reviewers

The script was built with LLM help so let me know if something is not clear.

Checklist

Before review:

  • Changelog entry added.
    • Explains the change in Changed, Fixed, Added sections.
    • For API change contains an example snippet and/or migration example.
    • JIRA ticket linked, example (case %%). If it is a private issue, just add the case ID without a link.
    • Jira port for the next release set as "Resolved".
  • Tests added/changed, if applicable.
    • Functional tests Area_CanDoX, Area_CanDoX_EvenIfYIsTheCase, Area_WhenIDoX_AndYHappens_ThisIsTheResult.
    • Performance tests.
    • Integration tests.
  • Docs for new/changed API's.
    • Xmldoc cross references are set correctly.
    • Added explanation how the API works.
    • Usage code examples added.
    • The manual is updated, if needed.

During merge:

  • Commit message for squash-merge is prefixed with one of the list:
    • NEW: ___.
    • FIX: ___.
    • DOCS: ___.
    • CHANGE: ___.
    • RELEASE: 1.1.0-preview.3.

Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

May require changes

The PR introduces a useful check script, but there is a critical issue where the check can silently pass if ripgrep is missing or fails. Several other minor improvements regarding script robustness and comment filtering were identified.

🤖 Helpful? 👍/👎

Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh Outdated
Comment thread check-runtime-editor-refs.sh
@codecov-proxy.fjygbaifeng.eu.org
Copy link
Copy Markdown

codecov-proxy.fjygbaifeng.eu.org Bot commented May 4, 2026

Codecov Report

All modified and coverable lines are covered by tests ✅

@@             Coverage Diff             @@
##           develop    #2413      +/-   ##
===========================================
+ Coverage    78.13%   78.71%   +0.58%     
===========================================
  Files          483      755     +272     
  Lines        98770   137572   +38802     
===========================================
+ Hits         77169   108295   +31126     
- Misses       21601    29277    +7676     
Flag Coverage Δ
inputsystem_MacOS_2022.3 5.36% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_2022.3_project 75.40% <50.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.0 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.0_project 77.29% <100.00%> (-0.01%) ⬇️
inputsystem_MacOS_6000.3 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.3_project 77.29% <100.00%> (+0.01%) ⬆️
inputsystem_MacOS_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.4_project 77.30% <100.00%> (+0.01%) ⬆️
inputsystem_MacOS_6000.5 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.5_project 77.33% <100.00%> (+0.01%) ⬆️
inputsystem_MacOS_6000.6 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_MacOS_6000.6_project 77.33% <100.00%> (+0.01%) ⬆️
inputsystem_Ubuntu_2022.3_project 75.30% <50.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.0 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.0_project 77.20% <100.00%> (-0.01%) ⬇️
inputsystem_Ubuntu_6000.3 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.3_project 77.19% <100.00%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.4_project 77.21% <100.00%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.5_project 77.24% <100.00%> (+0.01%) ⬆️
inputsystem_Ubuntu_6000.6 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Ubuntu_6000.6_project 77.24% <100.00%> (+0.01%) ⬆️
inputsystem_Windows_2022.3 5.36% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_2022.3_project 75.53% <50.00%> (-0.01%) ⬇️
inputsystem_Windows_6000.0 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.0_project 77.41% <100.00%> (-0.02%) ⬇️
inputsystem_Windows_6000.3 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.3_project 77.41% <100.00%> (+0.01%) ⬆️
inputsystem_Windows_6000.4 5.34% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.4_project 77.42% <100.00%> (+0.01%) ⬆️
inputsystem_Windows_6000.5 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.5_project 77.46% <100.00%> (+0.01%) ⬆️
inputsystem_Windows_6000.6 5.33% <0.00%> (+0.02%) ⬆️
inputsystem_Windows_6000.6_project 77.46% <100.00%> (+0.01%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

Files with missing lines Coverage Δ
...InputSystem/Editor/InputSystemEditorInitializer.cs 76.77% <100.00%> (ø)
...y.inputsystem/InputSystem/Runtime/InputSettings.cs 80.48% <100.00%> (ø)

... and 239 files with indirect coverage changes

ℹ️ Need help interpreting these results?

@jfreire-unity
Copy link
Copy Markdown
Collaborator Author

/crc

Copy link
Copy Markdown
Contributor

@u-pr u-pr Bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great

The review identified opportunities to optimize workflow triggers and improve the robustness of the reference checking script by ensuring word-boundary matching.

🤖 Helpful? 👍/👎

Comment thread .github/workflows/check-runtime-editor-refs.yml Outdated
Comment thread check-runtime-editor-refs.sh Outdated
jfreire-unity and others added 3 commits May 4, 2026 14:05
Co-authored-by: u-pr[bot] <205906871+u-pr[bot]@users.noreply.github.com>
Co-authored-by: u-pr[bot] <205906871+u-pr[bot]@users.noreply.github.com>
@jfreire-unity jfreire-unity requested a review from Pauliusd01 May 5, 2026 06:39
@jfreire-unity
Copy link
Copy Markdown
Collaborator Author

For @Pauliusd01 , the impact of code changes is mainly in these inspectors but we should not see any changes vs develop
image

@jfreire-unity jfreire-unity merged commit 0f3b085 into develop May 5, 2026
126 checks passed
@jfreire-unity jfreire-unity deleted the add-check-runtime-editor-refs-gha-workflow branch May 5, 2026 07:29
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants